﻿using System;

namespace Genericity
{
    class Program
    {
        static void Main(string[] args)
        {
            Apple apple = new Apple() { Color = "blue" };
            Book book = new Book() { Name = "田憨" };
            Box<Apple> app = new Box<Apple>() { Cargo = apple };
            Box<Book> book1 = new Box<Book>() { Cargo = book };
            Console.WriteLine(app.Cargo.Color);
            Console.WriteLine(book1.Cargo.Name);
        }
        class Apple
        {
            public string Color { get; set; }
        }
        class Book
        {
            public string Name { get; set; }
        }
        class Box<TCargo>
        {
            public TCargo Cargo { get; set; }
        }




    }
}
